# 代码编写者： 李朔
# 开发时间： 2021/9/6 19:05
s="bbaa"
t='aba'
#代码超时
def delete_s(s,c):
    c_index=s.find(c)
    s=s[:c_index]+s[c_index+1:]
    return s
def minWindow(s,t):
    #t的大小为初始滑块窗口大小
    t_size=len(t)
    print(t_size)
    #滑块的左右指针
    l_p,r_p=0,t_size
    end=t_size
    while r_p-l_p<=len(s):
        # is_have=False
        print("第{0}轮".format(r_p-l_p))
        while r_p<=len(s):
            s_sub=s[l_p:r_p]
            print("切割的子串：",s_sub)
            have_i=True
            for i in t:
                if i in s_sub:
                    s_sub=delete_s(s_sub,i)
                    print("sub:",s_sub)
                    continue
                else:
                    have_i=False
                    break
            if have_i==True:
                return s[l_p:r_p]
            else:
                l_p+=1
                r_p+=1
        end+=1
        l_p,r_p=0,end
    return ""
print(minWindow(s,t))
